//
//  BBMVCController.h
//  BattleFrontierV3
//
//  Created by Eric on 12/23/11.
//  Copyright (c) 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

#define MVC_PLIST_FILE @"BBMVC"

/*--------Request----------*/
@interface BBMVCRequest : NSObject {
    id param;
    SEL reqMethod;
    id callbackTgt;
    SEL callbackMethod;
}
@property(nonatomic, retain)id param;
@property(nonatomic)SEL reqMethod;

@property(nonatomic, retain)id callbackTgt;
@property(nonatomic)SEL callbackMethod;
@end

/*--------Action----------*/
@interface BBMVCAction : NSObject
-(void)shareContext;
-(id)doTask:(BBMVCRequest*)request;
-(void)doTaskAsyn:(BBMVCRequest*)request;
-(id)doAction:(id)param;
@end


/*--------Dispather----------*/
@interface BBMVCDispatcher : NSObject{
    NSDictionary* _actions;
    NSDictionary* _rules;
    NSOperationQueue* _opQueue;
}
+(BBMVCDispatcher*)dispatcher;
-(void)initDispatcher:(NSString*)configFile;
-(id)request:(NSString*)request;
-(id)request:(NSString*)request param:(id)param;
-(void)requestAsyn:(NSString*)request param:(id)param callbackTgt:(id)tgt callback:(SEL)method;
@end



